cordova.define("cordova/plugin/toasts", function(require, exports, module) {
	var exec = require("cordova/exec");
	module.exports = {
		showShort : function(message, win, fail) {
			exec(win, fail, "Toasts", "show_short", [ message ]);
		},
		showLong : function(message, win, fail) {
			exec(win, fail, "Toasts", "show_long", [ message ]);
		},
		cancel : function(win, fail) {
			exec(win, fail, "Toasts", "cancel", []);
		}
	};
});

function toast(text,duration) {
	 var toasts = cordova.require("cordova/plugin/toasts");
	 if(duration=="short") {
	  toasts.showShort(text,
	  function() {
	   //console.log("PhoneGap Plugin: Toast short: callback success");
	  },
	  function() {
	   console.log("PhoneGap Plugin: Toast short: callback error");
	  });
	 } else if(duration=="long") {
	  toasts.showLong(text,
	  function() {
	   //console.log("PhoneGap Plugin: Toast long: callback success");
	  },
	  function() {
	   console.log("PhoneGap Plugin: Toast long: callback error");
	  });
	 } else {
	  toasts.cancel(
	  function() {
	   //console.log("PhoneGap Plugin: Toast cancel: callback success");
	  },
	  function() {
	   console.log("PhoneGap Plugin: Toast cancel: callback error");
	  });
	 }
	}
